def course_context_processor(request):
    print 'executing course_context_processor...'
    context = {
        'course': getattr(request,'course',None),
        'profile': getattr(request, 'course',None),
    }
    
    if hasattr(request, course):
        for f in request.course.features:
            context.update(f.template_context_hook(request))
    
    return context
